package com.wcs.exam.controller.admin;

import com.wcs.exam.common.base.Result;
import com.wcs.exam.common.base.annotation.OptLog;
import com.wcs.exam.controller.admin.biz.AdminDashboardBiz;
import com.wcs.exam.controller.admin.resp.AdminDashboardStatDataResp;
import com.wcs.exam.controller.admin.resp.AdminDashboardStatLoginResp;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wcs
 * @since 2024-07-06
 */
@Tag(name = "Admin-概况")
@RestController
@RequiredArgsConstructor
@RequestMapping("/v1/admin/dashboard")
public class AdminDashboardController {

    @NotNull
    private final AdminDashboardBiz biz;

    @Operation(summary = "登录统计")
    @OptLog(value = "概况-登录统计")
    @GetMapping(value = "/stat/login")
    public Result<AdminDashboardStatLoginResp> statLogin(@RequestParam Integer dates) {
        return biz.statLogin(dates);
    }

    @Operation(summary = "数据统计")
    @OptLog(value = "概况-数据统计")
    @GetMapping(value = "/stat/data")
    public Result<AdminDashboardStatDataResp> statData() {
        return biz.statData();
    }
}
